<template>
  <div>
    <!-- 使用自定义插件 -->
    <!-- <h1 v-upper="msg"></h1> -->
    <Header></Header>
    <!-- 摆放路由的地方 -->
    <router-view></router-view>
    <!-- Footer在home和search页面显示,其他页面隐藏掉 -->
    <Footer v-show="$route.meta.show"></Footer>
  </div>
</template>

<script>
import Header from "./components/Header";
import Footer from "./components/Footer";

export default {
  name: "App",
  components: {
    Header,
    Footer,
  },

  mounted() {
    //派发一个action,获取商品三级分类列表数据
    this.$store.dispatch("categoryList");
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
